﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;

namespace UCS.XNA.Utils
{
    public static class KeysExtensionMethods
    {
        public static char ToChar(this Keys that)
        {
            char key;
            if (that >= Keys.NumPad0 && that <= Keys.NumPad9)
                key = Convert.ToChar(that - (Keys.NumPad0 - Keys.D0));
            else if (that == Keys.OemPeriod || that == Keys.PageDown)
                key = '.';
            else
                key = Convert.ToChar(that);

            return key;
        }
    }
}
